using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Navigation;
using Lib.Helper;
using MSIACCSL2.ViewModels;
using WcfService1.DTO;

namespace MSIACCSL2.Views.Inventory
{
    public partial class FrmAdd : Page
    {
        public InventoryViewModel VM
        {
            get { return (InventoryViewModel)this.DataContext; }
        }

        private AlokasiSaldoAwal alokasiSaldoAwal;
        public FrmAdd()
        {
            InitializeComponent();
            this.KeyUp += new KeyEventHandler(FrmAdd_KeyUp);
           
        }

        void FrmAdd_KeyUp(object sender, KeyEventArgs e)
        {
            //if (e.Key == Key.S && Keyboard.Modifiers == ModifierKeys.Control)
            //    //VM.SaveSaldoAwalInventory(VM.Inventory);
            //else if (e.Key == Key.C && Keyboard.Modifiers == ModifierKeys.Control)
            //    NavigationService.GoBack();
        }

      

        private void CancelButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
        	NavigationService.GoBack();
        }

        private void OKButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {

            //VM.SaveSaldoAwalInventory(VM.Inventory);
            
        }

        private void TextBox_GotFocus(object sender, System.Windows.RoutedEventArgs e)
        {
        	(sender as TextBox).SelectAll();
        }

        private void btnAlokasi_Click(object sender, System.Windows.RoutedEventArgs e)
        {
        	alokasiSaldoAwal = new AlokasiSaldoAwal();
            alokasiSaldoAwal.Show();
            //EventAggregator.PublishMessage("LoadInventoryWarehouse",VM.Inventory);
        }

    }
}

